import 'package:flutter/material.dart';
import 'package:lai_zhan/widget/TextInput.dart';
import 'package:lai_zhan/widget/EnsureVisibleWhenFocused.dart';

class EnsureVisibleTextInput extends StatelessWidget {

  FocusNode focusNode;
  TextEditingController controller;
  ValueChanged<String> onChange;
  Icon icon;
  String hintText;
  String errorText;
  String labelText;
  EdgeInsetsGeometry padding;
  EdgeInsetsGeometry margin;
  bool obscureText;
  InputBorder inputBorder;
  TextInputType keyboardType;
  double fontSize;
  TextAlign textAlign;
  Color textColor;


  EnsureVisibleTextInput({this.focusNode, this.controller, this.onChange,
    this.icon, this.hintText, this.errorText, this.labelText, this.padding,
    this.margin, this.obscureText = false, this.inputBorder, this.keyboardType,
    this.fontSize,this.textAlign = TextAlign.left,this.textColor});

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return new EnsureVisibleWhenFocused(focusNode: focusNode,
      child: new TextInput(
        controller: controller,
        icon: icon,
        hintText: hintText,
        errorText: errorText,
        labelText: labelText,
        padding: padding,
        margin: margin,
        obscureText: obscureText,
        inputBorder: inputBorder,
        keyboardType: keyboardType,
        fontSize: fontSize,
        textAlign: textAlign,
        textColor: textColor,
      ),
    );;
  }

}